package com.wp.aop01.service;

import com.wp.aop01.service.Impl.OrderService;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import java.lang.instrument.ClassFileTransformer;

/**
 * @author: WangPeng
 * @createTime: 2022/11/11 20:46
 * @description:
 * @version: v1.0
 */
public class Test01 {
    public static void main(String[] args) {
        ApplicationContext app = new ClassPathXmlApplicationContext("springmvc.xml");
        //该类使用了接口---使用JDK动态代理
        IUserService userService = app.getBean(IUserService.class);
        userService.save();
        //该类没有实现接口---切面使用cglib动态代理
//        OrderService orderService = app.getBean(OrderService.class);
//        orderService.save();
    }
}
